package com.bbzn.device.client.service.impl;

import com.bbzn.device.client.dao.history.AlarmHisEnMapper;
import com.bbzn.device.client.dataobject.AlarmHisEn;
import com.bbzn.device.client.dto.history.AlarmHisDTO;
import com.bbzn.device.client.service.AlarmHisEnService;
import com.bbzn.device.client.utils.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author wulongbo
 * @Date 2021/6/9 11:29
 * @Version 1.0
 */
@Service
public class AlarmHisEnServiceImpl implements AlarmHisEnService {

    @Resource
    private AlarmHisEnMapper alarmHisEnMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return alarmHisEnMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(AlarmHisEn record) {
        return alarmHisEnMapper.insert(record);
    }

    @Override
    public int insertOrUpdate(AlarmHisEn record) {
        return alarmHisEnMapper.insertOrUpdate(record);
    }

    @Override
    public int insertOrUpdateSelective(AlarmHisEn record) {
        return alarmHisEnMapper.insertOrUpdateSelective(record);
    }

    @Override
    public int insertSelective(AlarmHisEn record) {
        return alarmHisEnMapper.insertSelective(record);
    }

    @Override
    public AlarmHisEn selectByPrimaryKey(Long id) {
        return alarmHisEnMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(AlarmHisEn record) {
        return alarmHisEnMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(AlarmHisEn record) {
        return alarmHisEnMapper.updateByPrimaryKey(record);
    }

    @Override
    public int updateBatch(List<AlarmHisEn> list) {
        return alarmHisEnMapper.updateBatch(list);
    }

    @Override
    public int updateBatchSelective(List<AlarmHisEn> list) {
        return alarmHisEnMapper.updateBatchSelective(list);
    }

    @Override
    public int batchInsert(List<AlarmHisEn> list) {
        return alarmHisEnMapper.batchInsert(list);
    }

    @Override
    public PageInfo<AlarmHisEn> alarmHistroryLimt(AlarmHisDTO alarmHis) {
        List<AlarmHisEn> alarmHisList = alarmHisEnMapper.alarmHistroryLimt(alarmHis);
        Integer totalRecord = alarmHisEnMapper.alarmHisCount(alarmHis);
        PageInfo<AlarmHisEn> pageInfo = new PageInfo<>();
        pageInfo.setPageNum(alarmHis.getPageNum());
        pageInfo.setPageSize(alarmHis.getPageSize());
        pageInfo.setTotalRecord(totalRecord);
        pageInfo.setResultList(alarmHisList);
        return pageInfo;
    }

    @Override
    public int alarmHisEnCount(AlarmHisDTO record) {
        return alarmHisEnMapper.alarmHisCount(record);
    }

    @Override
    public List<AlarmHisEn> findByAll(AlarmHisEn alarmHisEn) {
        return alarmHisEnMapper.findByAll(alarmHisEn);
    }

    @Override
    public int deleteByImei(String imei) {
        return alarmHisEnMapper.deleteByImei(imei);
    }
}








